<?php
/**
 * Joomla! 1.5 component JoomGPSTracks
 *
 * @version $Id: form.php 2009-08-10 15:40:19 svn $
 * @author Michael Pfister
 * @package joomGPStracks
 * @subpackage backend
 * @license GNU/GPL
 * @filesource
 *
 */

defined('_JEXEC') or die('Restricted access');

// toolbar
JToolBarHelper::title(JText::_('GPS_ADD_TRACK'), 'categories.png');
JToolBarHelper::back($alt= 'Back', $href= 'javascript:history.back();');
JToolBarHelper::spacer();
if($this->id < 1):
JToolBarHelper::save('savetrack', 'Save', 'save.png' );
else:
JToolBarHelper::save('updatetrack', 'Save', 'save.png' );
endif;


?>
<form action="" method="post" name="adminForm" id="adminForm" class="adminForm" enctype="multipart/form-data">
    <table class="adminlist" cellpadding="1">
        <thead>
            <tr>
                <th colspan="2" align="center"><?php echo JText::_('GPS_ADD_TRACK'); ?></th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td><?php echo JText::_('GPS_TITLE'); ?>*</td>
                <td><input id="title" type="text" name="title" value="<?php if(isset($this->id)) echo $this->track->title; ?>" size="30" /></td>
            </tr>
            <tr>
                <td><?php echo JText::_('GPS_LEVEL'); ?>*</td>
                <td><select name="level">
                        <option><?php echo JText::_('GPS_SELECT'); ?></option>
                        <option value="1" <?php if(isset($this->id) && $this->track->level == 1): echo "selected='selected'"; endif; ?> >1</option>
                        <option value="2" <?php if(isset($this->id) && $this->track->level == 2): echo "selected='selected'"; endif; ?> >2</option>
                        <option value="3" <?php if(isset($this->id) && $this->track->level == 3): echo "selected='selected'"; endif; ?> >3</option>
                        <option value="4" <?php if(isset($this->id) && $this->track->level == 4): echo "selected='selected'"; endif; ?> >4</option>
                        <option value="5" <?php if(isset($this->id) && $this->track->level == 5): echo "selected='selected'"; endif; ?> >5</option>
                    </select></td>
            </tr>
            <tr>
                <td><?php echo JText::_('GPS_CAT'); ?></td>
                <td><?php echo $this->lists['cats']; ?></td>
            </tr>
            <tr>
                <td><?php echo JText::_('GPS_ACCESS_LEVEL'); ?></td>
                <td><?php echo $this->lists['access']; ?></td>
            </tr>
            <?php
            if($this->id < 1)  {
            ?>
            <tr>
                <td><?php echo JText::_('GPS_FILE'); ?>*</td>
                <td><input type="file" name="file" value="" size="30" /></td>
            </tr>
            <?php } ?>
            <tr>
                <td><?php echo JText::_('GPS_TERRAIN'); ?></td>
                <td><?php echo $this->lists['terrain']; ?></td>
            </tr>
            <tr>
                <td><?php echo JText::_('GPS_DESCRIPTION'); ?>*</td>
                <td><?php echo $this->editor->display( 'description', $this->track->description , '500', '200', '15', '25', false ) ; ?></td>
            </tr>
            <tr>
                <td valign="top"><?php echo JText::_('GPS_IMAGES'); ?> (max. 10)</td>
                <td><input type="file" name="images[]" class="multi" maxlength="10"><br clear="all"/></td>
            </tr>
            <?php
            if($this->cfg->terms == 1):
            ?>
            <tr>
                <td><?php echo JText::_('GPS_TERMS'); ?></td>
                <td><input id="terms" type="checkbox" name="terms" value="" /><?php echo JText::_('GPS_AGREE'); ?> <a class="modal" href="<?php echo $this->terms; ?>" target="_blank"><?php echo JText::_('GPS_TERMS'); ?></a></td>
            </tr>
            <?php
            endif;
            ?>
        </tbody>
    </table>
    <?php
    echo JHTML::_( 'form.token' ); ?>
    <input type="hidden" name="option" value="com_joomgpstracks" />
    <input type="hidden" name="controller" value="tracks" />
    <input type="hidden" name="task" value="" />
    <input type="hidden" name="id" value="<?php echo $this->id; ?>" />
</form>